package com.atguigu.hellomp;


import com.atguigu.hellomp.entity.User;
import com.atguigu.hellomp.mapper.UserMapper;
import com.atguigu.hellomp.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class T3 {

    @Autowired
    UserMapper userMapper;

    @Autowired
    UserService userService;

    @Test
    public void a(){
        User user = new User();
        user.setName("zhang3");
        user.setAge(20);
        user.setEmail("123");
        userMapper.insert(user);

    }

    @Test
    public void b(){
        // userMapper.deleteById(7L);
        userService.removeById(4L);
    }

    @Test
    public void c(){
        List<User> users = userMapper.selectList(null);
        System.out.println(users);
    }

}
